function showSelectWin(id,title,url,itarget,buttonText,iwidth, iheight){
	//if(typeof buttonText!='string')
	buttonText="就绪";	
	var width=iwidth;
	var height=iheight;	
	if(typeof width!="number") width=618;
	if(typeof height!="number") height=450;
	var msg="<iframe  width='"+(width-20)+"' frameborder='0' height='"+(height-50)+"' src='"+url+"'>";
	var s=document.getElementsByTagName("select"); //--------------把所有select标签捉住
	for(var j=0;j<s.length;j++){s[j].style.display="none";} //--------------设为不显示，再进行下面操作	
	if(typeof itarget=='string' && getObject("targetnameinput_"+id)==false ){		
		var targetinput = document.createElement("input"); 
		targetinput.type='hidden';
		targetinput.id="targetnameinput_"+id;
		targetinput.value=itarget;
		document.body.appendChild(targetinput);
	}
	
	var iWidth = document.documentElement.clientWidth; 
	var iHeight = document.documentElement.clientHeight; 
	var bgObj = document.createElement("div"); 
	bgObj.id="bg"+id;
	bgObj.className="main_background"
	
	bgObj.style.width=iWidth+"px";
	bgObj.style.height=Math.max(document.body.clientHeight, iHeight)+"px";
	
	document.body.appendChild(bgObj);
	
	var msgObj=document.createElement("div");
	msgObj.id=id;
	msgObj.className="dialog";
	
	msgObj.style.top=0;//(iHeight-height)/2+"px";
	msgObj.style.left=0;//(iWidth-width)/2+"px";
	msgObj.style.width=width+"px";
	msgObj.style.height=height+"px";
	
	document.body.appendChild(msgObj);	
	var table = document.createElement("table");
	msgObj.appendChild(table);
	table.style.cssText = "margin:0px;border:0px;padding:0px;";
	table.cellSpacing = 0;
	var tr = table.insertRow(-1);
	var titleBar = tr.insertCell(-1);
	titleBar.className="dialog_titleBar";	
	titleBar.style.paddingLeft = "5px";
	titleBar.innerHTML = title;
	var moveX = 0;
	var moveY = 0;
	var moveTop = 0;
	var moveLeft = 0;
	var moveable = false;
	var docMouseMoveEvent = document.onmousemove;
	var docMouseUpEvent = document.onmouseup;
	titleBar.onmouseup = function() {
		moveable = false; 
	}
	titleBar.onmousedown = function() {
		var evt = getEvent();
		moveable = true; 
		moveX = evt.clientX;
		moveY = evt.clientY;
		moveTop = parseInt(msgObj.style.top);
		moveLeft = parseInt(msgObj.style.left);	
		document.onmouseout = function() {	
			moveable = false; 			
		}
		document.onmousemove = function() {			
			if (moveable) {								
					var evt = getEvent();									
					var x = moveLeft + evt.clientX - moveX;
					var y = moveTop + evt.clientY - moveY;
					if ( x > 0 &&( x + width < iWidth) && y > 0 && (y + height < iHeight) ) {
						msgObj.style.left = x + "px";
						msgObj.style.top = y + "px";
					}					
			}
		};
		document.onmouseup = function () { 
			if (moveable) { 
				document.onmousemove = docMouseMoveEvent;
				document.onmouseup = docMouseUpEvent;
				moveable = false; 						
				moveX = 0;
				moveY = 0;
				moveTop = 0;
				moveLeft = 0;
			} 
		};
	}
	
	var closeBtn = tr.insertCell(-1);
	closeBtn.className="dialog_closeBtn";	
	closeBtn.align="right";
	closeBtn.innerHTML = "<span style='font-size:14pt; color:#FFFFFF;'>×</span>";
	closeBtn.onclick = function(){ 
		for(var j=0;j<s.length;j++){s[j].style.display="block";} //--------------再给select显出来
		document.body.removeChild(bgObj); 
		document.body.removeChild(msgObj); 
	}
	var msgBox = table.insertRow(-1).insertCell(-1);
	msgBox.style.cssText = "font:10pt '宋体';";
	msgBox.colSpan  = 2;
	msgBox.innerHTML = msg;	
	/**
	var buttonTB = document.createElement('TABLE');
	buttonTB.className="dialog_buttonTB";	
	buttonTB.style.top=(height-16)+"px";
	buttonTB.style.width=width+"px";
	buttonTB.cellSpacing = 0;
	var td = buttonTB.insertRow(-1).insertCell(-1);
	td.innerHTML = buttonText;
	msgObj.appendChild(buttonTB);
	*/	
    // 获得事件Event对象，用于兼容IE和FireFox
    function getEvent() {
	    return  window.event || arguments.callee.caller.arguments[0];
    }
} 
function closeSelectWin(id){
	var s=parent.document.getElementsByTagName("select"); //--------------把所有select标签捉住
	for(var j=0;j<s.length;j++){s[j].style.display="block";} //--------------再给select显出来
	var bgObj=getObject(parent.document,"bg"+id);
	var dialogObj=getObject(parent.document,id);
	if(bgObj==false||dialogObj==false)
		alert("错误的对话框ID");
	else{
		parent.document.body.removeChild(bgObj);
		parent.document.body.removeChild(dialogObj);	
	}	
}
function closeSelectWinAndSet(id,t1value,t2value,t3value){
	var targetNameInputObj=getObject(parent.document,'targetnameinput_'+id);	
	if(typeof targetNameInputObj=='object'){
		names=targetNameInputObj.value;		
		if(names.indexOf("t1=")>=0){			
			t1=names.substring(names.indexOf("t1=")+3 ,names.indexOf(";",names.indexOf("t1=")) );			
			getObject(parent.document,t1).value=t1value;
			try{getObject(parent.document,t1).focus();}catch(e){}
		}
		if(names.indexOf("t2=")>=0 && typeof t2value=='string'){
			t2=names.substring(names.indexOf("t2=")+3 ,names.indexOf(";",names.indexOf("t2=")) );
			getObject(parent.document,t2).value=t2value;
			try{getObject(parent.document,t2).focus();}catch(e){}
		}
		if(names.indexOf("t3=")>=0 && typeof t3value=='string'){
			t3=names.substring(names.indexOf("t3=")+3 ,names.indexOf(";",names.indexOf("t3=")) );
			getObject(parent.document,t3).value=t3value;
			try{getObject(parent.document,t2).focus();}catch(e){}
		}
	}
	closeSelectWin(id);	
}
function setSelected(id,t1value,t2value,t3value){	
	alert(id+";"+t1value+";"+t2value+";"+t3value);
	var targetNameInputObj=getObject(parent.document,id);		
	if(typeof targetNameInputObj=='object'){
		names=targetNameInputObj.value;		
		if(names.indexOf("t1=")>=0){			
			t1=names.substring(names.indexOf("t1=")+3 ,names.indexOf(";",names.indexOf("t1=")) );			
			getObject(parent.document,t1).value=t1value;
			try{getObject(parent.document,t1).focus();}catch(e){}
		}
		if(names.indexOf("t2=")>=0 && typeof t2value=='string'){
			t2=names.substring(names.indexOf("t2=")+3 ,names.indexOf(";",names.indexOf("t2=")) );
			getObject(parent.document,t2).value=t2value;
			try{getObject(parent.document,t2).focus();}catch(e){}
		}
		if(names.indexOf("t3=")>=0 && typeof t3value=='string'){
			t3=names.substring(names.indexOf("t3=")+3 ,names.indexOf(";",names.indexOf("t3=")) );
			getObject(parent.document,t3).value=t3value;
			try{getObject(parent.document,t3).focus();}catch(e){}
		}
	}	
}
function closeSelectWinAndClear(id){	
	closeSelectWinAndSet(id,"","","");	
}

function showIframe(id,title,url,itarget,buttonText,iwidth, iheight,top,left){
	if(typeof buttonText!='string') buttonText="";	
	var width=iwidth;
	var height=iheight;	
	if(typeof width!="number") width=618;
	if(typeof height!="number") height=450;
	var msg="<iframe  width='"+(width-18)+"' frameborder='0' height='"+(height-50)+"' src='"+url+"'>";	
	if(typeof itarget=='string' && getObject("targetnameinput_"+id)==false ){		
		var targetinput = document.createElement("input"); 
		targetinput.type='hidden';
		targetinput.id="targetnameinput_"+id;
		targetinput.value=itarget;
		document.body.appendChild(targetinput);
	}	
	var iWidth = document.documentElement.clientWidth; 
	var iHeight = document.documentElement.clientHeight; 
	var bgObj = document.createElement("div"); 
	bgObj.id="bg"+id;
	bgObj.className="main_background";
	bgObj.style.width=iWidth+"px";
	bgObj.style.height=Math.max(document.body.clientHeight, iHeight)+"px";	
	document.body.appendChild(bgObj);	
	var msgObj=document.createElement("div");
	msgObj.id=id;
	msgObj.className="dialog";	
	msgObj.style.top=top;
	msgObj.style.left=left+"px";	
	msgObj.style.width=width+"px";
	msgObj.style.height=height+"px";	
	document.body.appendChild(msgObj);	
	var table = document.createElement("table");
	msgObj.appendChild(table);
	table.style.cssText = "margin:0px;border:0px;padding:0px;";
	table.cellSpacing = 0;	
	var msgBox = table.insertRow(-1).insertCell(-1);
	msgBox.style.cssText = "font:10pt '宋体';";
	msgBox.colSpan  = 2;
	msgBox.innerHTML = msg;		
    function getEvent() {
	    return  window.event || arguments.callee.caller.arguments[0];
    }
} 